package com.atguigu.UDP_b;

import java.io.IOException;
import java.net.*;

import static java.net.InetAddress.getAllByName;

public class Client {
    public static void main(String[] args) throws IOException {

        DatagramSocket socket = new DatagramSocket();

        byte[] bytes = "今晚啤酒烧烤、小龙虾~~~".getBytes();
        InetAddress ip = InetAddress.getByName("127.0.0.1");
        int port = 6666;
        DatagramPacket packet = new DatagramPacket(bytes, bytes.length,ip,port);

        socket.send(packet);

        socket.close();

        System.out.println("客户端发送成功~~~~~");
    }
}
